*-------------------------------------------------------------------------------
* Description: Download 1990-2022 LAUS data
* Author: Justin Wiltshire
*
* Updated: July 25, 2023
*-------------------------------------------------------------------------------

* Make directory
capture mkdir "$projdir/dta/build/src/laus"

* Loop over all years
forval i = 0/32 {
	
	* Create the year value as in the data names
	if inrange(`i', 0, 9) {
		local y "9`i'"
	}
	else if inrange(`i', 10, 19) {
		local j = `i' - 10
		local y "0`j'"
	}
	else if `i' > 19 {
		local j = `i' - 10
		local y "`j'"
	}

	* Download the data
	#delimit ;
		copy
			https://www.bls.gov/lau/laucnty`y'.xlsx
			"$projdir/dta/build/src/laus/laucnty`y'.xlsx", replace;
		#delimit cr		
	local f = 1
}
